﻿<Canvas
	xmlns="http://schemas.microsoft.com/client/2007"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
	xmlns:SilverlightToolbox="clr-namespace:SilverlightToolbox;assembly=ClientBin/SilverlightToolbox.dll"
	x:Name="UserControl"
	Width="640" Height="480" Background="#FFFFFFFF">
	
	<Canvas.Resources>
		<Storyboard x:Name="ballonExplode">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ballon" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
				<SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ballon" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
				<SplineDoubleKeyFrame KeyTime="00:00:01" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ballon" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
				<SplineDoubleKeyFrame KeyTime="00:00:01" Value="359"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Name="RectagnleFinishedChangingColors">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
				<SplineDoubleKeyFrame KeyTime="00:00:02" Value="235"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
				<SplineDoubleKeyFrame KeyTime="00:00:02" Value="100"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
				<SplineDoubleKeyFrame KeyTime="00:00:02" Value="-200"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Name="RectangleClicked">
			<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
				<SplineColorKeyFrame KeyTime="00:00:00" Value="#FFB72323"/>
				<SplineColorKeyFrame KeyTime="00:00:02" Value="#FF2339B7"/>
			</ColorAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(Shape.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
				<SplineColorKeyFrame KeyTime="00:00:00" Value="#FFEE9191"/>
				<SplineColorKeyFrame KeyTime="00:00:02" Value="#FFEE91E9"/>
			</ColorAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(SkewTransform.AngleX)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
				<SplineDoubleKeyFrame KeyTime="00:00:02" Value="38"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</Canvas.Resources>
	<Canvas.Triggers>
		<EventTrigger RoutedEvent="Canvas.Loaded">
			<BeginStoryboard>
				<Storyboard x:Name="moveBallon">
					<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" RepeatBehavior="Forever" Storyboard.TargetName="ballon" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
						<SplineDoubleKeyFrame KeyTime="00:00:01" Value="360"/>
						<SplineDoubleKeyFrame KeyTime="00:00:03" Value="-368"/>
						<SplineDoubleKeyFrame KeyTime="00:00:04" Value="38"/>
					</DoubleAnimationUsingKeyFrames>
					<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ballon" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
						<SplineDoubleKeyFrame KeyTime="00:00:01" Value="-32"/>
						<SplineDoubleKeyFrame KeyTime="00:00:03" Value="-32"/>
						<SplineDoubleKeyFrame KeyTime="00:00:04" Value="-15.5"/>
					</DoubleAnimationUsingKeyFrames>
				</Storyboard>
			</BeginStoryboard>
		</EventTrigger>
	</Canvas.Triggers>
	<Rectangle OpacityMask="#FF7D2323" RenderTransformOrigin="0.5,0.5" x:Name="rectangle" Width="160" Height="88" Stroke="#FF000000" Canvas.Left="56" Canvas.Top="336">
		<Rectangle.RenderTransform>
			<TransformGroup>
				<ScaleTransform ScaleX="1" ScaleY="1"/>
				<SkewTransform AngleX="0" AngleY="0"/>
				<RotateTransform Angle="0"/>
				<TranslateTransform X="0" Y="0"/>
			</TransformGroup>
		</Rectangle.RenderTransform>
		<Rectangle.Fill>
			<LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
				<GradientStop Color="#FFEE9191" Offset="0.228"/>
				<GradientStop Color="#FFB72323" Offset="1"/>
			</LinearGradientBrush>
		</Rectangle.Fill>
	</Rectangle>
	<SilverlightToolbox:EventToAction Width="8" Height="16" Canvas.Left="192" Canvas.Top="232" TargetBegin="True" ElementsToListenName="ballon" ListenToMouseLeftButtonDown="True" Target_Name="ballonExplode"/>
	
	<SilverlightToolbox:EventToAction x:Name="EventToAction_RectagnleFinishedChangingColors" Width="8" Height="0" Canvas.Left="32" Canvas.Top="424" TargetBegin="True" ElementsToListenName="RectangleClicked" ListenToCompleted="True" Target_Name="RectagnleFinishedChangingColors"/>
	<Canvas RenderTransformOrigin="0.5,0.5" x:Name="ballon" Width="88" Height="256.5" Canvas.Left="280" Canvas.Top="96">
		<Canvas.RenderTransform>
			<TransformGroup>
				<ScaleTransform ScaleX="1" ScaleY="1"/>
				<SkewTransform AngleX="0" AngleY="0"/>
				<RotateTransform Angle="0"/>
				<TranslateTransform X="0" Y="0"/>
			</TransformGroup>
		</Canvas.RenderTransform>
		<Ellipse x:Name="ellipse" Width="88" Height="128">
			<Ellipse.Fill>
				<RadialGradientBrush GradientOrigin="0.986,0.994">
					<RadialGradientBrush.RelativeTransform>
						<TransformGroup>
							<ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.649" ScaleY="1.397"/>
							<SkewTransform AngleX="0" AngleY="0" CenterX="0.5" CenterY="0.5"/>
							<RotateTransform Angle="-3.366" CenterX="0.5" CenterY="0.5"/>
							<TranslateTransform X="0.023" Y="-0.064"/>
						</TransformGroup>
					</RadialGradientBrush.RelativeTransform>
					<GradientStop Color="#FFFFF2F2" Offset="0.062"/>
					<GradientStop Color="#FFFF0000" Offset="0.782"/>
					<GradientStop Color="#FF000000" Offset="0.945"/>
					<GradientStop Color="#FF000000" Offset="0"/>
				</RadialGradientBrush>
			</Ellipse.Fill>
		</Ellipse>
		<Path Width="51.534" Height="131" Stretch="Fill" Stroke="#FF000000" Canvas.Left="8.024" Canvas.Top="125.5" Data="M323,222 C317.31245,224.3851 267.56093,249.91219 308,258 319.68066,260.33613 344.46458,256.98682 338,285 332.73144,307.83041 312.93277,311.31551 293,324 287.45759,327.52699 285.32538,337.82776 297,346 303.86562,350.80593 317.01574,350.11483 325,352"/>
	</Canvas>
	<SilverlightToolbox:EventToAction x:Name="EventToAction_RectangleClicked" Width="8" Height="0" Canvas.Left="32" Canvas.Top="304" TargetBegin="True" ElementsToListenName="rectangle" ListenToMouseLeftButtonDown="True" Target_Name="RectangleClicked"/>
	
</Canvas>